<%= render 'spree/admin/shared/general_tabs' %>

<% admin_breadcrumb(Spree.t(:settings)) %>
<% admin_breadcrumb(Spree.t(:general_settings)) %>

<%= form_tag admin_general_settings_path, method: :put do %>
  <div id="preferences" data-hook>

    <fieldset class="general no-border-top">

      <%= fields_for :store do |f| %>
        <div data-hook="admin_general_setting_input_name">
          <%= f.field_container :name do %>
            <%= f.label :name %>
            <%= f.text_field :name, class: 'fullwidth' %>
            <%= f.error_message_on :name %>
          <% end %>
        </div>

        <div data-hook="admin_general_setting_input_seo_title">
          <%= f.field_container :seo_title do %>
            <%= f.label :seo_title %>
            <%= f.text_field :seo_title, class: 'fullwidth'  %>
            <%= f.error_message_on :seo_title %>
          <% end %>
        </div>

        <div data-hook="admin_general_setting_input_meta_keywords">
          <%= f.field_container :meta_keywords do %>
            <%= f.label :meta_keywords %>
            <%= f.text_field :meta_keywords, class: 'fullwidth'  %>
            <%= f.error_message_on :meta_keywords %>
          <% end %>
        </div>

        <div data-hook="admin_general_setting_input_meta_description">
          <%= f.field_container :meta_description do %>
            <%= f.label :meta_description %>
            <%= f.text_field :meta_description, class: 'fullwidth'  %>
            <%= f.error_message_on :meta_description %>
          <% end %>
        </div>

        <div data-hook="admin_general_setting_input_url">
          <%= f.field_container :url do %>
            <%= f.label :url %>
            <%= f.text_field :url, class: 'fullwidth'  %>
            <%= f.error_message_on :url %>
          <% end %>
        </div>

        <div data-hook="admin_general_setting_mail_from_address">
          <%= f.field_container :mail_from_address do %>
            <%= f.label :mail_from_address %>
            <%= f.text_field :mail_from_address, class: 'fullwidth'  %>
            <%= f.error_message_on :mail_from_address %>
          <% end %>
        </div>
      <% end %>

      <% if can? :update, :general_settings %>
        <div class="form-buttons filter-actions actions" data-hook="buttons">
          <%= button Spree.t('actions.update') %>
          <%= link_to Spree.t('actions.cancel'), edit_admin_general_settings_url, :class => 'button' %>
        </div>
      <% end %>

    </fieldset>

  </div>
<% end %>
